#ifndef _KC_ATTCH_H__KC_
#define _KC_ATTCH_H__KC_

#include <unicode/unistr.h>
#include "MimeDefaults.h"
#include "ContentType.h"
#include "BodyPart.h"

namespace kc_sf
{
	class Attachment
	{
		public:

			std::string aFilename;

			Attachment(const std::string &text, const ContentType &ct);
			Attachment(const std::string &text,
				EncodingType encoding,
				const std::string &charset,
				const ContentType &ct);
			virtual Attachment *clone() const;
			virtual ~Attachment() {}

			const UnicodeString & getDecodedText(); // lazy loading
			const std::string & getOriginalText() const;
			unsigned long getSize() const;
			std::string getFilename() const;
			std::string getExtension() const;
			const ContentType & getContentType() const { return a_content_type; }

		protected:

			ContentType a_content_type;
			BodyPart a_body;
	};
}

#endif // _KC_ATTCH_H__KC_
